// /////////////////////////////////////////////////////////////////////////////
//
// Name:            AIPanel.h
// Author:          Michael Bartsch
//
// Desc :           The interface for the CAIPanel class.
//
// License:         Copyright (C) 2008-2009 Michael Bartsch
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the GNU General Public
//                  License as published by the Free Software Foundation,
//                  either version 3 of the License, or (at your option) any
//                  later version.
//
//                  This program is distributed in the hope that it will be
//                  useful, but WITHOUT ANY WARRANTY; without even the implied
//                  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//                  PURPOSE. See the GNU General Public License for more
//                  details.
//
//                  You should have received a copy of the GNU General Public
//                  License along with this program. If not, see
//                  <http://www.gnu.org/licenses/>.
//
// /////////////////////////////////////////////////////////////////////////////

#ifndef __C_AIPANEL_H_INCLUDED__
#define __C_AIPANEL_H_INCLUDED__

// Include required header file(s).
#include "../../../Engine/AICore.h"
#include "../../App.h"
#include "./AIFrame.h"


// Forward Declarations.
class CAIFrame;
class CAICore;

// Enumerations.
enum AIP_States
{
   AIP_Start = 0,
   AIP_Target,
   AIP_Walkable,
   AIP_Unwalkable,
   AIP_Unknown
};


// The CAIPanel class.
//! The AI Panel which can be used to directly manipulate the node map of the AI Core.
class CAIPanel : public wxPanel
{
public:

    //! Constructor
    //! @param parent The window parent.
    CAIPanel(wxWindow *parent);

    //! Updates the buffer that is eventually painted on the screen.
    void updateBuffer();

    //! Adjusts the scrollbars of the panel.
    void adjustScrollbars();

    // Event functions.
    //! Handles the paint event.
    void onPaint(wxPaintEvent &event);

    //! Handles scrollbar events.
    void onScroll(wxScrollWinEvent &event);

    //! Handles mouse events.
    void onMouseEvent(wxMouseEvent &event);

    //! Sets the state of the panel.
    void setState(int state);


private:

    // Internal
    CAIFrame *frameParent;
    CAICore *pAICore;

    // wxWidgets
    wxImage *bufferImage;
    wxBitmap *bufferBitmap;

    int panelState;

    DECLARE_EVENT_TABLE()
};

#endif
